<?php 
require_once 'sesi_login.php';
require_once 'konfigurasi.php';

fungsi('pegawai');

define('PAGE', 'Pegawai');
define('PAGE_ICO', 'icon-parents');
define('PAGE_URL', 'resetpasword.php');

koneksi_buka();
panggil_header();
?>

<div id="da-content-area">
<div class="row-fluid">

<div class="span12">
	<div class="da-panel">
		<div class="da-panel-content da-table-container">
		<?php if(isset($_GET['resetpassword'])) { ?>
				<div class="da-message success">
					Password untuk user <?php echo $_GET['user'];?> berhasil diubah ke password default yaitu : pengguna
				</div>				
		<?php } ?>
<table id="da-ex-datatable-numberpaging" class="da-table checkable">
	<thead>
		<tr>
			<th>NIP</th>
			<th>NAMA LENGKAP</th>
			<th>USERNAME</th>
			<th>RESET PASSWORD</th>
		</tr>
	</thead>
	<tbody>
		<?php 
			$q = mysql_query("
				SELECT a.*,b.nm_lengkap,b.nip,c.nm_jabatan FROM t_pengguna a
				inner join t_pegawai b on a.kd_pengguna=b.kd_pengguna
				inner join r_jabatan c on c.kd_jabatan=b.kd_jabatan
				where a.jns_pengguna <> 'admin' and a.jns_pengguna <> 'superadmin'
			");
			while($dt = mysql_fetch_array($q)) {
		?>
		<tr>
			<td><?php echo nip($dt['nip']) ?></td>
			<td><?php echo $dt['nm_lengkap'] ?></td>
			<td><?php echo $dt['username'] ?></td>
			
			<td width="5%">
				<a href="modul/pegawai/pegawai.proses.php?kd=<?php echo $dt['kd_pengguna'] ?>&reset=user&username=<?php echo $dt['username'] ?>" rel="tooltip" data-placement="top" title="Reset Password"	id="reset-password">
					<i class="icol-cross"></i>
				</a>&nbsp;&nbsp;&nbsp;
			</td>
		</tr>
		<?php } ?>
	</tbody>
</table>		
		
		</div>
	</div>
	
</div>

</div>
</div>

<?php
panggil_footer();
koneksi_tutup();
?>
